Options:
-h, --help Print this message
--git Initialize a new git repository with a .gitignore
+ --travis Create a .travis.yml file
--bin Use a binary instead of a library template
-v, --verbose Use verbose output
")
debug!("executing; cmd=cargo-new; args={}", os::args());
shell.set_verbose(options.flag_verbose);
- let Options { flag_git, flag_bin, arg_path, .. } = options;
+ let Options { flag_git, flag_travis, flag_bin, arg_path, .. } = options;
let opts = ops::NewOptions {
git: flag_git,
+ travis: flag_travis,
path: arg_path.as_slice(),
bin: flag_bin,
};
pub struct NewOptions<'a> {
pub git: bool,
+ pub travis: bool,
pub bin: bool,
pub path: &'a str,
}
try!(fs::mkdir(path, io::UserRWX));
}
+ if opts.travis {
+ try!(File::create(&path.join(".travis.yml")).write_str("language: rust\n"));
+ }
+
let author = try!(discover_author());
try!(File::create(&path.join("Cargo.toml")).write_str(format!(
r#"[package]